package com.imooc.girl;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.RepositoryDefinition;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
//@RepositoryDefinition(domainClass = Girl.class, idClass = Integer.class)
public interface GrilRespository extends JpaRepository<Girl, Integer> {

    /*
    通过年龄来查询
     */
    public List<Girl> findByAge(Integer Age);

//    @Override
//    List<Girl> findAll();

    /*

    @Modifying
    @Query("update Girl g set g.age = :age where g.id = :id")
    public void updateById(Integer id, Integer age);
    */
}
